<template>
    <div>
      欢迎评价
      <br/>
      <br/>
      <input type="text" v-model="detail">
      <br/>
      <br/>
      <button @click="on_detail">评论</button>
    </div>
</template>

<script>
    import axios from "axios";

    export default {
        name: "datails",
        data(){
          return{
            detail:''
          }
        },
        methods: {
          on_detail() {
            var name = localStorage.getItem('name');
            var id = localStorage.getItem('id');
            axios({
              url: 'http://127.0.0.1:8000/add_datail/',
              method: 'POST',
              data: {'ids': id,'detail':this.detail,'name':name}

            }).then(res => {
                localStorage.setItem('detail',this.detail);
                this.$router.push('/show');

                console.log(res);


            })
          }
        }
    }
</script>

<style scoped>

</style>
